home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.37 / battclock / units / battclocklight.p < prev    next >
Text File  |  1994-09-17  |  2KB  |  78 lines

  1. { Unit:      BattClockLight
  2.  
  3.   Version:   1.04 (1993-1994)
  4.  
  5.   Meaning:   read battclock: time and day an put it in two strings
  6.  
  7.   for:       KP2.12/OS2 or MaxonPASCAL3
  8.  
  9.   Copyright: FW, you must use authors name in Info or Doc
  10.  
  11.   Author:    PackMAN
  12.              c/o Falk Zühlsdorff
  13.              Lindenberg 66
  14.              D-98693 Ilmenau / Thuringia                              }
  15.  
  16. UNIT BattClockLight;
  17.  
  18. INTERFACE
  19.  
  20. {$opt q}
  21. Uses UTILITY;
  22. {$ INCL 'resources/battclock.h'}        {MP3: + battclock.lib}
  23.  
  24. FUNCTION GetBattClockL:boolean;
  25.  
  26. VAR battclocktime,
  27.     battclockdate : string;             {wanna use PROCEDURE(VAR: )}
  28.  
  29. IMPLEMENTATION
  30.  
  31. FUNCTION GetBattClockL;
  32. VAR  current:p_ClockData;
  33. BEGIN
  34.  BattclockBase:=OpenResource(BATTCLOCKNAME);
  35.  IF (BattclockBase<>NIL) AND (UtilityBase<>NIL)
  36.   THEN
  37.    BEGIN
  38.     NEW(current);
  39.     Amiga2Date(ReadBattClock,current);
  40.     battclockdate:='';
  41.     IF current^.mday<10
  42.       THEN battclockdate:=('0'+INTSTR(current^.mday)+'.')
  43.       ELSE battclockdate:=(INTSTR(current^.mday)+'.');
  44.     IF current^.month<10
  45.      THEN battclockdate:=(battclockdate+'0'+INTSTR(current^.month)+
  46.                           '.'+INTSTR(current^.year))
  47.      ELSE battclockdate:=(battclockdate+INTSTR(current^.month)+'.'+
  48.                           INTSTR(current^.year));
  49.      battclocktime:='';
  50.      IF current^.hour<10
  51.       THEN battclocktime:=('0'+INTSTR(current^.hour)+':')
  52.       ELSE battclocktime:=(INTSTR(current^.hour)+':');
  53.      IF current^.min<10
  54.       THEN battclocktime:=(battclocktime+'0'+INTSTR(current^.min)+':')
  55.       ELSE battclocktime:=(battclocktime+INTSTR(current^.min)+':');
  56.      IF current^.sec<10
  57.       THEN battclocktime:=(battclocktime+'0'+INTSTR(current^.sec))
  58.       ELSE battclocktime:=(battclocktime+INTSTR(current^.sec));
  59.      GetBattclockL:=true;
  60.    END
  61.   ELSE
  62.     GetBattclockL:=false;
  63. END;
  64.  
  65. END.
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.